In this step you add the object generator in the C application of your Kanzi application and register it to factory.
To add the object generator:

/** * The name and location of the animation that is played when an object is highlighted. * You create the animation in the Kanzi Studio project of the application. * To get the correct path to the animation, in Kanzi Studio in * Library > Animations > Animation Clips right-click the animation clip you use * to highlight the selected object and select Copy as kzb URL. */ #define NAME_ANIMATION "kzb://object_generator/Animation Clips/Highlight" /** * Factory string for object generator. The trajectory list box uses this generator by specifying * this name as the value for KZU_PROPERTY_TYPE_LIST_BOX_OBJECT_GENERATOR_TYPE_NAME. * In Kanzi Studio project set the property Object Generator to the same value used here. */ #define OBJECT_GENERATOR_FACTORY_STRING "ObjectGenerator" /** * Name of the property that sets the resource ID of the prefab template that * is used to display objects in the trajectory list box. * You create this property in the Kanzi Studio project of the application. */ #define OBJECT_GENERATOR_PREFAB_TEMPLATE_PROPERTY_TYPE "ItemTemplate" /** * The source file that contains the list of items that the object generator displays. * The object generator refreshes the items in the list when you save the file to disk. * The object generator reads the source file from the directory <KanziWorkspace>/Tutorials/ * Object generator/Application/bin. * Note that you have to save the file in the UTF-8 format. */ #define OBJECT_SOURCE_FILE "list.txt"
To add the headers and register the object generator to factory:
#include <application/kza_application_interface.h> #include <application/kza_application.h> #include <user/ui/factory/kzu_factory.h> #include <user/ui/components/listbox/kzu_object_generator.h> #include <core/memory/kzc_memory_manager.h> #include "dynamic_object_generator.h"
KZ_CALLBACK static kzsError startupHandler(struct KzaApplication* application) { kzsError result; struct KzuFactory* factory = kzaApplicationGetFactory(application);
result = objectGeneratorRegisterToFactory(factory); kzsErrorForward(result);
kzsSuccess(); }
kzApplicationConfigure function call the startupHandler function when your Kanzi application loads and set the window size of the application to 1280x720 pixels.configuration->onStartup = startupHandler; configuration->windowProperties.width = 1280; configuration->windowProperties.height = 720;

To see in the Kanzi Studio Preview how the dynamic object generator works, you have to build the toolmodule application for your project in the your Visual Studio solution.
To create the toolmodule application for your Kanzi Studio project:





To find out more about what you can create using the Kanzi Engine API, see API reference.
To learn more about creating Kanzi applications, see Tutorials.
To find out more about Kanzi Studio features, see Working with ....